package com.niit.game;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration  // "相当于一个spring-benas.xml文件"
public class MyConfig {
    @Bean("audio2") // 相当于<bean id="audo" class="com.niit.game.Audio"/>
    public Audio audio(){
        return new Audio();
    }

    @Bean("audio1") // 相当于<bean id="audo2" class="com.niit.game.Audio"/>
    public Audio audio2(){
        return new Audio();
    }
    @Bean
    public Game game(){
        return new Game();
    }
}
